Skip to content

feat: add zyzz/bun plugin - #529

Open
deodad wants to merge 2 commits into
wevm:mainfrom
deodad:feat/bun-plugin
Open

deodad wants to merge 2 commits into
wevm:mainfrom
deodad:feat/bun-plugin

Conversation

@deodad

@deodad deodad commented Nov 11, 2026

Copy link
Copy Markdown

Note

Stacked on #528: this branch includes its commit. Review only the last commit, and merge after #528.

zyzz/esbuild fails under Bun.build with build.resolve() is not implemented yet (oven-sh/bun#2771). Unplugin 3 has a Bun target, so zyzz.bun (also zyzz from zyzz/bun) wraps it and resolves through Bun.resolveSync, honoring external. It requires outdir, and the scan skips it.

Bun lowers light-dark() in bundled package CSS to --buncss-light and --buncss-dark and sets them only beside the color-scheme declarations it compiles. Without a fallback, every such color dropped. zyzz.css from Bun ends with :where(:root){--buncss-light:initial;--buncss-dark: }, which selects the light value, as light-dark() does by default.

import { zyzz } from 'zyzz/bun'

await Bun.build({ entrypoints: ['src/main.tsx'], outdir: 'dist', plugins: [zyzz({ root: 'src' })] })
Same page Time
vite build (with #527) ~1.0 s
bun build.ts with zyzz/bun, whole process 0.51 s

Bun output renders pixel-identical to the Vite build in light and dark schemes.

Validation: new bun resolves installed packages and emits stylesheets scenario, tsc, and the same suites (212 tests) pass. CI installs Bun in the test job (oven-sh/setup-bun pinned to v2.2.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant